package com.wf.smartcomm.server.bean;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.google.gson.annotations.Expose;

@Entity
@Table(name = "t_discount")
public class Discount {
	@Expose
	@Id
	@Column(length = 32)
	private String objectId;
	
	@Expose
	@Column(length = 20)
	private String createdAt;
	
	@Expose
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="vid")
	private Village village;
	
	@Expose
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="uid")
	private User user;
	
	@Expose
	@Column
	private Float discount;
	
	@Expose
	@Column(length = 20)
	private String beginAt;
	
	@Expose
	@Column(length = 20)
	private String endAt;
	
	@Expose
	@Column(length = 20)
	private String fromAt;
	
	@Expose
	@Column(length = 20)
	private String toAt;

	public String getObjectId() {
		return objectId;
	}

	public void setObjectId(String objectId) {
		this.objectId = objectId;
	}

	public String getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(String createdAt) {
		this.createdAt = createdAt;
	}

	public Village getVillage() {
		return village;
	}

	public void setVillage(Village village) {
		this.village = village;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}


	public String getBeginAt() {
		return beginAt;
	}

	public void setBeginAt(String beginAt) {
		this.beginAt = beginAt;
	}

	public String getEndAt() {
		return endAt;
	}

	public void setEndAt(String endAt) {
		this.endAt = endAt;
	}

	public String getFromAt() {
		return fromAt;
	}

	public void setFromAt(String fromAt) {
		this.fromAt = fromAt;
	}

	public String getToAt() {
		return toAt;
	}

	public void setToAt(String toAt) {
		this.toAt = toAt;
	}

	public Float getDiscount() {
		return discount;
	}

	public void setDiscount(Float discount) {
		this.discount = discount;
	}
}
